package jsyf.oa.entity.system;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author: 徐波
 * @creat: 2017/11/23 0023 15:33
 * description:
 */
@Entity
@Table(name = "T_SYS_ROLE", schema = "oa", catalog = "")
public class RoleEntity extends BaseEntity {
    private String name;
    private String departId;
    private Integer sortNo;
    private String roleNameId;
    private Integer targetNumber;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDepartId() {
        return departId;
    }

    public void setDepartId(String departId) {
        this.departId = departId;
    }

    public Integer getSortNo() {
        return sortNo;
    }

    public void setSortNo(Integer sortNo) {
        this.sortNo = sortNo;
    }

    public String getRoleNameId() {
        return roleNameId;
    }

    public void setRoleNameId(String roleNameId) {
        this.roleNameId = roleNameId;
    }

    public Integer getTargetNumber() {
        return targetNumber;
    }

    public void setTargetNumber(Integer targetNumber) {
        this.targetNumber = targetNumber;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject json = new JSONObject();
        json.put("ID",this.getId());
        json.put("NAME",this.getName());
        json.put("DEPART_ID",this.getDepartId());
        json.put("SORT_NO",this.getSortNo());
        json.put("DEL_FLAG",this.getDelFlag());
        json.put("ROLE_NAME_ID",this.getRoleNameId());
        json.put("TARGET_NUMBER",this.getTargetNumber());
        return json;
    }

    @Override
    public String getTableName() {
        return "T_SYS_ROLE";
    }


    @Override
    public String getViewName() {
        return "V_SYS_ROLE";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject json = new JSONObject();
        json.put("ID","id");
        json.put("NAME","name");
        json.put("DEPART_ID","departId");
        json.put("SORT_NO","sortNo");
        json.put("DEL_FLAG","delFlag");
        json.put("ROLE_NAME_ID","roleNameId");
        json.put("TARGET_NUMBER","targetNumber");


        return json;
    }
}
